package com.gitee.wsl.doc.soup.ext

internal fun String.cleanTitle() = if (lastIndexOf("|") > length / 2) {
    substring(0, indexOf("|")).trim()
} else {
    removeWhiteSpace()
}

/** Remove more than two spaces or newlines */
internal fun String.removeWhiteSpace() = replace("\\s+".toRegex(), " ").trim { it <= ' ' }


const val DEF_TEXT_TAG_NAME = "JX_TEXT"

const val EL_SAME_TAG_INDEX_KEY = "EL_SAME_TAG_INDEX"

const val EL_SAME_TAG_ALL_NUM_KEY = "EL_SAME_TAG_ALL_NUM"

const val EL_DEPTH_KEY = "EL_DEPTH"

